package com.xjscrm.console.vo;

import com.xjscrm.common.enums.WwFriendReqScene;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel("客户查询返回对象")
public class WwCustomerVo {
@ApiModelProperty("主键ID")
    private Long id;

    @ApiModelProperty("商户ID")
    private Long merId;

    @ApiModelProperty("机器人唯一ID")
    private Long deviceUniqueId;

    @ApiModelProperty("客户昵称")
    private String name;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("性别（0-未知；1-男；2-女）")
    private Integer gender;

    @ApiModelProperty("称呼")
    private String nickname;

    @ApiModelProperty("状态（0-拉黑，1-正常）")
    private Integer status;

    @ApiModelProperty("微信ID")
    private String wxid;
    @ApiModelProperty("客户头像")
    private String headImgUrl;

    @ApiModelProperty(" 添加场景（0-未知；1-扫描二维码；2-手机号搜索；3-好友分享名片；4-群内）")
    private Integer scene;

    @ApiModelProperty("描述")
    private String description;

    @ApiModelProperty("添加方式（0-客户主动添加；2-机器人主动添加）")
    private Integer addType;

    @ApiModelProperty("手机号")
    private String mobile;

    @ApiModelProperty("同步通讯录时间")
    private Integer pushTime;

    @ApiModelProperty("创建时间")
    private Integer createTime;

    @ApiModelProperty("修改时间")
    private Integer updateTime;

    @ApiModelProperty("企业标签id")
    private List<Long> wwtagIds;

    @ApiModelProperty("个人标签id")
    private List<Long> personTagIds;

    @ApiModelProperty("企业标签")
    private List<String> wwtagNames;

    @ApiModelProperty("个人标签")
    private List<String> personTagNames;

    @ApiModelProperty("添加场景描述")
    private String sceneDesc;

    @ApiModelProperty("已添加的机器人")
    private List<AddedDeviceVo> addedDeviceVoList;

    @ApiModelProperty("机器人微信昵称")
    private String deviceName;

    @ApiModelProperty("是否在白名单中")
    private boolean inWhiteList;
    @ApiModelProperty("是否在黑名单中")
    private boolean inBlackList;


    @ApiModelProperty(value = "企业标签",hidden = true)
    private String wwtagNamesDesc;

    @ApiModelProperty(value = "个人标签",hidden = true)
    private String personTagNamesDesc;


    @ApiModelProperty("机器人微信头像")
    private String deviceHeadImageUrl;

    @ApiModelProperty("企业id")
    private String corpId;

    @ApiModelProperty("会员内部账号")
    private String externalUserid;

    public void setSceneDescByScene(){
        if(this.scene!=null){
            sceneDesc= WwFriendReqScene.getById(this.scene).getDesc();
        }
    }

    public void setWwtagNamesDesc(){
        if(this.wwtagNames!=null&&!this.wwtagNames.isEmpty()){
            this.wwtagNamesDesc=String.join(",",this.wwtagNames);
        }
    }

    public void setPersonTagNamesDesc(){
        if(this.personTagNames!=null&&!this.personTagNames.isEmpty()){
            this.personTagNamesDesc=String.join(",",this.personTagNames);
        }
    }
}
